 <script th:inline="javascript">
/*<![CDATA[*/
	/* $(document).ready(function(){ 
　　		$("#category_grid tr td span").each(function(){ 
　　			var count=$(".select_brandType").get(0).options.length;
　　	　　		for(var i=0;i<count;i++){
　　	　　			
　　	　　			if($(".select_brandType").get(0).options[i].text == $(this).text())  
　　	　　			{
　　	　　				$(".select_brandType").get(0).options[i].selected = true;          
　　	　　				break;  
　　	　　			}
　　	　　		}
    		
　　		}); 
　　		
	});  */
	
	/* $(function(){
	    $(".select_brandType").change(function(){
	            alert($(this).val());
				
	    });

	}); */
	function change(val,id){
		alert(val);
		
	}
/*]]>*/
</script>
<form role="form" th:action="@{/admin/product/category/saveCategory}" id="rank_check" name="theForm" th:object="${userRank}"
			method="post" class="form-horizontal">
<table class="table table-striped table-bordered  table-advance table-hover" id="category_grid">
	<thead>
		<tr>
			<th>分类名称</th>
			<th>所属分类</th>
			<th>排序</th>
			<th>操作</th>
		</tr>
	</thead>	
	<tbody>
		<tr class="odd gradeX" th:each="data : ${category.categoryList}">
			<tr th:if="${data.flag == 0}">
				<td style="display:none">
				<input style="text-align: center;" type="text" th:name="|categoryList[${dataStat.index}].id|" th:value="|${data.id}|" MaxLength='10' />
				</td>
				<td><input tyle="text-align: center;" type="text" th:name="|categoryList[${dataStat.index}].name|" th:value="|${data.name}|" MaxLength='10' /></td>
				<td style="text-align: center;">
				</td>
				<td style="text-align: center;"><input tyle="text-align: center;" type="text" th:name="|categoryList[${dataStat.index}].sort|" th:value="|${data.sort}|" MaxLength='10' /></td>
				<td style="text-align: center;">
				<a href="#" th:href="@{'/category/addSon/'+${data.id}}"
					th:attr="id=${'link_delete_'+dataStat.index},name=${'link_delete_'+dataStat.index}"
					class="btn default btn-xs purple"><i class="fa fa-minus"></i>添加子分类</a>
				<a href="#" th:href="@{'/admin/product/category/delete/'+${data.id}}"
					th:attr="id=${'link_delete_'+dataStat.index},name=${'link_delete_'+dataStat.index}"
					class="btn default btn-xs purple"><i class="fa fa-minus"></i>移除</a>
				</td >
			</tr>
			<tr th:if="${data.flag == 1}">
				<td style="display:none" >
				<input style="text-align: center;" type="text" th:name="|categoryList[${dataStat.index}].id|" th:value="|${data.id}|" MaxLength='10' />
				</td>
				<td ><img th:src="@{/img/L.gif}" src="/img/L.gif"/><input tyle="text-align: center;" type="text" th:name="|categoryList[${dataStat.index}].name|" th:value="|${data.name}|" MaxLength='10' /></td>
				<td style="text-align: center;">
				<span  th:text="${data.cateName}"></span>
				<!-- <select  class="select_brandType" style='width:150px;' name="selt_categoryType"  th:remove="none" onchange="change(this.value);">
				<option th:each="eachValue : ${categorys}" th:value="${eachValue.id}" th:text="${eachValue.name}" ></option>
				</select> -->
				</td>
				<td style="text-align: center;"><input tyle="text-align: center;" type="text" th:name="|categoryList[${dataStat.index}].sort|" th:value="|${data.sort}|" MaxLength='10' /></td>
				<td style="text-align: center;"><a href="#" th:href="@{'/admin/product/category/delete/'+${data.id}}"
					th:attr="id=${'link_delete_'+dataStat.index},name=${'link_delete_'+dataStat.index}"
					class="btn default btn-xs purple"><i class="fa fa-minus"></i>移除</a></td>
			</tr>
			
		</tr>
 	</tbody>
</table>
	<div class="form-actions fluid">
		<div class="col-md-offset-3 col-md-9">
			<button type="submit" class="btn blue" name="sub">保存修改内容</button>
		</div>
	</div>
	</form>